def insert_sort(data):

    print "original data: ", data

    for i in range(len(data)):
	print "i=",i
	for j in reversed(range(1, i+1)) :
	    if data[j]<data[j-1] :
		data[j], data[j-1] = data[j-1], data[j]
		print data

    print
    print "after sorting: ", data


data = [5,4,3,2,1]
insert_sort(data)

